/*     */ package com.qmsk.business.informake.infoResultItem.controller;
/*     */ 
/*     */ import com.utils.gson.out.GsonEbRst;
/*     */ import com.utils.http.HttpGsonPtResponseUtils;
/*     */ import com.utils.web.RequestUtils;
/*     */ import com.utils.web.ResponseUtils;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ import org.apache.log4j.Logger;
/*     */ import org.springframework.stereotype.Controller;
/*     */ import org.springframework.transaction.annotation.Transactional;
/*     */ import org.springframework.web.bind.annotation.PathVariable;
/*     */ import org.springframework.web.bind.annotation.RequestMapping;
/*     */ 
/*     */ @Controller
/*     */ @RequestMapping({"ptInfoRstItem"})
/*     */ public class InfoResultItemController
/*     */ {
/*  23 */   private static final Logger logger = Logger.getLogger(InfoResultItemController.class);
/*     */ 
/*     */   @RequestMapping(value={"find/shopId/{shopId}/opt/{infoId}/{pageIdx}/{pageSize}"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*     */   public void getListShopId(HttpServletRequest request, HttpServletResponse response, @PathVariable("shopId") Long shopId, @PathVariable("infoId") String infoId, @PathVariable("pageIdx") Integer nPageIdx, @PathVariable("pageSize") Short nPageSize)
/*     */   {
/*  41 */     nPageSize = RequestUtils.getRequestValidPageSize(nPageSize);
/*     */     try {
/*  43 */       String sData = "";
/*  44 */       String sUrl = "ptInfoRstItem/find/shopId/" + shopId + "/opt/" + infoId + "/" + nPageIdx + "/" + nPageSize;
/*  45 */       GsonEbRst rst = HttpGsonPtResponseUtils.getPtEbRst(sUrl, sData, response);
/*  46 */       if ((rst != null) && (rst.getState() == 0)) {
/*  47 */         ResponseUtils.setResponseResult(rst, response);
/*  48 */         return; }
/*  49 */       ResponseUtils.setSqlResultResponse(0, 
/*  50 */         RequestUtils.getSqlInsertDataErrorMessage(request), 
/*  51 */         response);
/*     */     }
/*     */     catch (Exception e) {
/*  54 */       logger.error(e);
/*  55 */       ResponseUtils.setErrorMsgResponse(
/*  56 */         RequestUtils.getFindDataErrorMessage(request), response);
/*     */     }
/*     */   }
/*     */ 
/*     */   @RequestMapping(value={"find/shopId/{shopId}/rstChoice/infoId/{infoId}"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*     */   public void getListRstChoiceInfoId(HttpServletRequest request, HttpServletResponse response, @PathVariable("infoId") String infoId, @PathVariable("shopId") Long shopId)
/*     */   {
/*     */     try
/*     */     {
/*  66 */       String sData = "";
/*  67 */       String sUrl = "ptInfoRstItem/find/shopId/" + shopId + "/rstChoice/infoId/" + infoId;
/*  68 */       GsonEbRst rst = HttpGsonPtResponseUtils.getPtEbRst(sUrl, sData, 
/*  69 */         response);
/*  70 */       if ((rst != null) && (rst.getState() == 0)) {
/*  71 */         ResponseUtils.setResponseResult(rst, response);
/*  72 */         return; }
/*  73 */       ResponseUtils.setSqlResultResponse(0, 
/*  74 */         RequestUtils.getSqlInsertDataErrorMessage(request), 
/*  75 */         response);
/*     */     }
/*     */     catch (Exception e) {
/*  78 */       logger.error(e);
/*  79 */       ResponseUtils.setErrorMsgResponse(
/*  80 */         RequestUtils.getFindDataErrorMessage(request), response);
/*     */     }
/*     */   }
/*     */ 
/*     */   @RequestMapping(value={"find/shopId/{shopId}/id/{id}"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*     */   public void getListId(HttpServletRequest request, HttpServletResponse response, @PathVariable("id") String id, @PathVariable("shopId") Long shopId)
/*     */   {
/*     */     try
/*     */     {
/*  89 */       String sData = "";
/*  90 */       String sUrl = "ptInfoRstItem/find/shopId/" + shopId + "/id/" + id;
/*  91 */       GsonEbRst rst = HttpGsonPtResponseUtils.getPtEbRst(sUrl, sData, 
/*  92 */         response);
/*  93 */       if ((rst != null) && (rst.getState() == 0)) {
/*  94 */         ResponseUtils.setResponseResult(rst, response);
/*  95 */         return; }
/*  96 */       ResponseUtils.setSqlResultResponse(0, 
/*  97 */         RequestUtils.getSqlInsertDataErrorMessage(request), 
/*  98 */         response);
/*     */     }
/*     */     catch (Exception e) {
/* 101 */       logger.error(e);
/* 102 */       ResponseUtils.setErrorMsgResponse(
/* 103 */         RequestUtils.getFindDataErrorMessage(request), response);
/*     */     }
/*     */   }
/*     */ 
/*     */   @Transactional
/*     */   @RequestMapping(value={"insert/shopId/{shopId}"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
/*     */   public void insert(HttpServletRequest request, HttpServletResponse response, @PathVariable("shopId") Long shopId)
/*     */   {
/* 120 */     String sGsonInData = RequestUtils.getString(request, "data");
/*     */     try {
/* 122 */       String sData = "data=" + sGsonInData;
/* 123 */       String sUrl = "ptInfoRstItem/insert/shopId/" + shopId;
/* 124 */       GsonEbRst rst = HttpGsonPtResponseUtils.postPtEbRst(sUrl, sData, 
/* 125 */         response);
/* 126 */       if ((rst != null) && (rst.getState() == 0)) {
/* 127 */         ResponseUtils.setResponseResult(rst, response);
/* 128 */         return; }
/* 129 */       ResponseUtils.setSqlResultResponse(0, 
/* 130 */         RequestUtils.getSqlInsertDataErrorMessage(request), 
/* 131 */         response);
/*     */     }
/*     */     catch (Exception e) {
/* 134 */       logger.error(e);
/* 135 */       ResponseUtils.setErrorMsgResponse(
/* 136 */         RequestUtils.getSqlInsertDataErrorMessage(request) + ":" + 
/* 137 */         e.getMessage(), response);
/*     */     }
/*     */   }
/*     */ 
/*     */   @Transactional
/*     */   @RequestMapping(value={"edit/shopId/{shopId}"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
/*     */   public void edit(HttpServletRequest request, HttpServletResponse response, @PathVariable("shopId") Long shopId)
/*     */   {
/* 154 */     String sGsonInData = RequestUtils.getString(request, "data");
/*     */     try {
/* 156 */       String sData = "data=" + sGsonInData;
/* 157 */       String sUrl = "ptInfoRstItem/edit/shopId/" + shopId;
/* 158 */       GsonEbRst rst = HttpGsonPtResponseUtils.postPtEbRst(sUrl, sData, 
/* 159 */         response);
/* 160 */       if ((rst != null) && (rst.getState() == 0)) {
/* 161 */         ResponseUtils.setResponseResult(rst, response);
/* 162 */         return; }
/* 163 */       ResponseUtils.setSqlResultResponse(0, 
/* 164 */         RequestUtils.getSqlUpdateDataErrorMessage(request), 
/* 165 */         response);
/*     */     }
/*     */     catch (Exception e) {
/* 168 */       logger.error(e);
/* 169 */       ResponseUtils.setErrorMsgResponse(
/* 170 */         RequestUtils.getSqlUpdateDataErrorMessage(request) + ":" + 
/* 171 */         e.getMessage(), response);
/*     */     }
/*     */   }
/*     */ 
/*     */   @Transactional
/*     */   @RequestMapping(value={"del/shopId/{shopId}"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
/*     */   public void delete(HttpServletRequest request, HttpServletResponse response, @PathVariable("shopId") Long shopId)
/*     */   {
/* 188 */     String id = RequestUtils.getStringOfId(request);
/*     */     try {
/* 190 */       String sData = "id=" + id;
/* 191 */       String sUrl = "ptInfoRstItem/del/shopId/" + shopId;
/* 192 */       GsonEbRst rst = HttpGsonPtResponseUtils.postPtEbRst(sUrl, sData, 
/* 193 */         response);
/* 194 */       if ((rst != null) && (rst.getState() == 0)) {
/* 195 */         ResponseUtils.setResponseResult(rst, response);
/* 196 */         return; }
/* 197 */       ResponseUtils.setSqlResultResponse(0, 
/* 198 */         RequestUtils.getSqlDeleteDataErrorMessage(request), 
/* 199 */         response);
/*     */     }
/*     */     catch (Exception e) {
/* 202 */       logger.error(e);
/* 203 */       ResponseUtils.setErrorMsgResponse(
/* 204 */         RequestUtils.getSqlDeleteDataErrorMessage(request) + ":" + 
/* 205 */         e.getMessage(), response);
/*     */     }
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.informake.infoResultItem.controller.InfoResultItemController
 * JD-Core Version:    0.5.3
 */